-
-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for --literal flag and literal entry in config #900
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: PanGan21 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution!
it mostly looks great! only with some nit we can discuss
doc/lsd.md
Outdated
@@ -140,6 +140,9 @@ lsd is a ls command with a lot of pretty colours and some other stuff to enrich | |||
`--header` | |||
: Display block headers | |||
|
|||
`--literal` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://man7.org/linux/man-pages/man1/ls.1.html
we can add -N
as short name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now!
doc/lsd.md
Outdated
@@ -140,6 +140,9 @@ lsd is a ls command with a lot of pretty colours and some other stuff to enrich | |||
`--header` | |||
: Display block headers | |||
|
|||
`--literal` | |||
: Do not show quotes on filenames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print entry names without quoting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it as well according to the manual
src/app.rs
Outdated
/// When showing files do not quote their names | ||
#[arg(long)] | ||
pub literal: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-N
and description align with https://man7.org/linux/man-pages/man1/ls.1.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it!
@@ -71,7 +73,7 @@ impl Core { | |||
// or require a raw output (like the `wc` command). | |||
inner_flags.layout = Layout::OneLine; | |||
|
|||
flags.should_quote = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about changing should_quote
to literal
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed!
src/meta/name.rs
Outdated
@@ -153,21 +153,21 @@ impl Name { | |||
format!( | |||
"{}{}", | |||
icons.get(self), | |||
self.hyperlink(self.escape(self.file_name(), quote), hyperlink) | |||
self.hyperlink(self.escape(self.file_name(), !quote), hyperlink) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you think quote
arg should change to literal as well in order to avoid this negation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! it would be great if you can also update this one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it as well!
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #900 +/- ##
==========================================
- Coverage 85.84% 85.38% -0.46%
==========================================
Files 50 51 +1
Lines 4932 4996 +64
==========================================
+ Hits 4234 4266 +32
- Misses 698 730 +32
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
hi @PanGan21, can you fix the CI errors |
I was using wrong rustc version, so I had to update |
thanks for the contribution! @PanGan21 |
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [v1.0.0] - 2023-08-25 | |||
|
|||
### Added | |||
- Add support for `--literal` from [PanGan21](https://github.com/PanGan21) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have gone to an already-released v1.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! actually, I was planning to use the GitHub auto-generate release note, this file may not be necessary, can you help create a PR to fix it and add a notice that we are no longer using this file, we use the GitHub auth-generate one instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly sure what you meant, but opened one here: #907
Let me know if it is what you meant.
Add support for
--literal
in order to opt out showing filenames with quotesCloses: #894
TODO
cargo fmt